# -*- coding: utf-8 -*-
# Project : flacon
# File : flac_encoder.py
# (c) Alexander Sokolov sokoloff.a@gmail.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

from PyQt4.QtCore import *
import flaconglobal

from encoderConfigPage import EncoderConfigPage
from wv_config_ui import Ui_wvConfigPage as UI

class WvConfig(EncoderConfigPage, UI):

   #****************************************************************
   #
   #****************************************************************
    @staticmethod
    def defaults():
        return {
            'WV/Compression':       1,
            'WV/ReplayGain':        flaconglobal.ReplayGainTypes.Disable,
        }


   #****************************************************************
   #
   #****************************************************************
    def __init__(self, parent):
        EncoderConfigPage.__init__(self, parent)
        self.setupUi(self)

        self.setLosslessToolTip(self.wvCompressionSlider)
        self.wvCompressionSpin.setToolTip(self.wvCompressionSlider.toolTip())
        self.fillReplayGainComboBox(self.wvGainCbx)

        self.loadSlider(  'WV/Compression', self.wvCompressionSlider)
        self.loadComboBox('WV/ReplayGain',  self.wvGainCbx)


   #****************************************************************
   #
   #****************************************************************
    def write(self):
        self.writeSlider(  'WV/Compression', self.wvCompressionSlider)
        self.writeComboBox('WV/ReplayGain',  self.wvGainCbx)

